OPTIONS = {}

def register_option(name):
    return OPTIONS.setdefault(name, 1 << len(OPTIONS))

def has_option(options, name):
    return bool(options & name )

BLUE = register_option('BLUE')
RED = register_option('RED')
WHITE = register_option('WHITE')

SET = BLUE | RED
print SET
print has_option(SET, BLUE)
print has_option(SET , WHITE)

print 1 | 2
print 3 & 4
print bool(5 & 4)
